home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / BlitzList / BlitzListFiles / qualifier.txt < prev    next >
Encoding:
Text File  |  1998-05-04  |  4.0 KB  |  120 lines

  1.     Case $400        ; a key has been pressed!
  2.  
  3.     i$=Inkey$        ; MOST IMPORTANT!!! Enables input to be read
  4.  
  5.       Select RawKey  ; find out which key it was
  6.       q=Qualifier
  7.  
  8.         FlushEvents  ; stop the storing of keypresses after the first keypress has been read
  9.  
  10.         Case $45     ; ESC key pressed
  11.           menuquit{}
  12.  
  13.         Case $4E     ; right arrow
  14.           If mappos.pos\x+(columns+1)<mapsize.size\x ; if not at righthand edge of map
  15.  
  16.             If q=1 OR q=2 ; left or right shift
  17.               UnBuffer 0 ; remove cursor and replace background
  18.               mappos\x=mappos\x+(columns+1) ; move whole screen to right
  19.               If mappos\x+(columns+1)>mapsize\x ; if gone over size of map
  20.                 mappos\x=mapsize\x-(columns+1)  ; set mappos\x within limits
  21.               EndIf
  22.               drawmap{rows,columns,shift}
  23.             Else
  24.  
  25.               If q=16 OR q=32 ; left or right Alt
  26.                 UnBuffer 0 ; remove cursor and replace background
  27.                 mappos\x=mappos\x+Int((columns+1)/4) ; move right
  28.                 If mappos\x+Int((columns+1)/4)>mapsize\x
  29.                   mappos\x=mapsize\x-Int((columns+1)/4)
  30.                 EndIf
  31.                 drawmap{rows,columns,shift}
  32.               Else
  33.                 mapright{rows,columns,shift,y_blit}
  34.               EndIf
  35.  
  36.             EndIf
  37.  
  38.           EndIf
  39.  
  40.         Case $4F     ; left arrow
  41.           If mappos\x>0 ; if not at lefthand edge of map
  42.  
  43.             If q=1 OR q=2 ; left or right shift
  44.               UnBuffer 0 ; remove cursor and replace background
  45.               mappos\x=mappos\x-(columns+1) ; move whole screen left
  46.               If mappos\x<0 ; If gone beyond map
  47.                 mappos\x=0  ; keep within limits
  48.               EndIf
  49.               drawmap{rows,columns,shift}
  50.             Else
  51.  
  52.               If q=16 OR q=32 ; left or right Alt
  53.                 UnBuffer 0 ; remove cursor and replace background
  54.                 mappos\x=mappos\x-Int((columns+1)/4) ; move right
  55.                 If mappos\x<0
  56.                   mappos\x=0
  57.                 EndIf
  58.                 drawmap{rows,columns,shift}
  59.               Else
  60.                 mapleft{rows,columns,shift,y_blit}
  61.               EndIf
  62.  
  63.             EndIf
  64.  
  65.           EndIf
  66.  
  67.         Case $4C     ; up arrow
  68.           If mappos\y>0 ; if not at top of map
  69.             If q=1 OR q=2 ; left or right shift
  70.               UnBuffer 0 ; remove cursor and replace background
  71.               mappos\y=mappos\y-(rows+1) ; move whole screen up
  72.               If mappos\y<0 ; beyond map
  73.                 mappos\y=0  ; keep within limits
  74.               EndIf
  75.               drawmap{rows,columns,shift}
  76.             Else
  77.  
  78.               If q=16 OR q=32 ; left or right Alt
  79.                 UnBuffer 0 ; remove cursor and replace background
  80.                 mappos\y=mappos\y-Int((rows+1)/4) ; move right
  81.                 If mappos\y<0
  82.                   mappos\y=0
  83.                 EndIf
  84.                 drawmap{rows,columns,shift}
  85.               Else
  86.                 mapup{rows,columns,shift,y_blit}
  87.               EndIf
  88.  
  89.             EndIf
  90.  
  91.           EndIf
  92.  
  93.         Case $4D     ; down arrow
  94.           If mappos\y+(rows+1)<mapsize\y ; if not at bottom of map
  95.  
  96.             If q=1 OR q=2 ; left or right shift
  97.               UnBuffer 0 ; remove cursor and replace background
  98.               mappos\y=mappos\y+(rows+1) ; move down whole screen
  99.               If mappos\y+(rows+1)>mapsize\y ; beyond limits
  100.                 mappos\y=mapsize\y-(rows+1) ; keep within limits
  101.               EndIf
  102.               drawmap{rows,columns,shift}
  103.             Else
  104.  
  105.               If q=16 OR q=32 ; left or right Alt
  106.                 UnBuffer 0 ; remove cursor and replace background
  107.                 mappos\y=mappos\y+Int((rows+1)/4) ; move right
  108.                 If mappos\y+((rows+1)/4)>mapsize\y
  109.                   mappos\y=mapsize\y-((rows+1)/4)
  110.                 EndIf
  111.                 drawmap{rows,columns,shift}
  112.               Else
  113.                 mapdown{rows,columns,shift,y_blit}
  114.               EndIf
  115.  
  116.             EndIf
  117.  
  118.           EndIf
  119.  
  120.